package edu.mse.camel.client.whiteboard.gef.ui.editpart;

import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPartFactory;

import edu.mse.camel.client.whiteboard.gef.whiteboard.Shape;
import edu.mse.camel.client.whiteboard.gef.whiteboard.WhiteboardDiagram;

public class WhiteboardTreeEditpartfactory implements EditPartFactory {

	/* (non-Javadoc)
	 * @see org.eclipse.gef.EditPartFactory#createEditPart(org.eclipse.gef.EditPart, java.lang.Object)
	 */
	public EditPart createEditPart(EditPart context, Object model) {
		if (model instanceof Shape) {
			return new ShapeTreeEditPart((Shape) model);
		}
		if (model instanceof WhiteboardDiagram) {
			return new WhiteboardDiagramTreeEditPart((WhiteboardDiagram) model);
		}
		return null; // will not show an entry for the corresponding model instance
	}

	}
